package com.example.taobaounion3.utils;

import java.util.concurrent.locks.ReentrantLock;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class RetrofitManager {
    //private  RetrofitManager ourInstance=new RetrofitManager();
    private   static Retrofit mRetrofit;
    private  static RetrofitManager ourInstance=null;
            //
    public static RetrofitManager getOurInstance() {
        if(ourInstance==null){
            synchronized (RetrofitManager.class){
                if(ourInstance==null){
                    ourInstance=new RetrofitManager();


                }
            }
        }
        return ourInstance;
//        return ourInstance;
    }

    private RetrofitManager(){
        mRetrofit= new Retrofit.Builder()
                .baseUrl(Constants.BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public  Retrofit getRetrofit(){
        return mRetrofit;
    }

}
